$OpenBSD: patch-src_ports_unix_unix_shared_c,v 1.2 2014/09/29 18:23:15 kirby Exp $

XXX: OpenBSD's locale support is very limited. This can probably
be removed when support for LC_MESSAGES is added.

--- src/ports/unix/unix_shared.cpp.orig	Thu Jun  5 08:18:39 2014
+++ src/ports/unix/unix_shared.cpp	Thu Jul  3 22:06:25 2014
@@ -106,9 +106,14 @@ const char *Sys_SetLocale (const char *localeID)
 	Sys_Setenv("LC_NUMERIC", "C");
 	setlocale(LC_NUMERIC, "C");
 
+# ifdef __OpenBSD__
+	if (Sys_Setenv("LC_ALL", localeID) != 0)
+		Com_Printf("...setenv for LC_ALL failed: %s\n", localeID);
+# endif /* __OpenBSD__ */
+
 	/* set to system default */
 	setlocale(LC_ALL, "C");
-	locale = setlocale(LC_MESSAGES, localeID);
+	locale = setlocale(LC_ALL, localeID);
 	if (!locale) {
 		if (Sys_Setenv("LANGUAGE", localeID) != 0) {
 			locale = localeID;
@@ -130,7 +135,7 @@ const char *Sys_SetLocale (const char *localeID)
 const char *Sys_GetLocale (void)
 {
 	/* Calling with nullptr param should return current system settings. */
-	const char *currentLocale = setlocale(LC_MESSAGES, nullptr);
+	const char *currentLocale = setlocale(LC_ALL, nullptr);
 	if (currentLocale != nullptr && currentLocale[0] != '\0')
 		return currentLocale;
 	else
